<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
	<script type="text/javascript">
		window.onload=function(){
			var oTxt=document.getElementById('txt1');
			var oBtn=document.getElementById('btn1');
            
            oBtn.onclick=function(){
            	var oNewWin = window.open('about:blank','_blank');
                oNewWin.document.write(oTxt.value);
            }

		}
	</script>
</head>
<body>
	<textarea id="txt1" rows='10' cols="50"></textarea><br />
	<input type="button" value="运行" id="btn1">
</body>
</html>